diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index b8efb9f881..76d71b1784 100644
--- a/django/utils/autoreload.py
+++ b/django/utils/autoreload.py
@@ -221,28 +221,20 @@ def get_child_arguments():
     py_script = Path(sys.argv[0])
 
     args = [sys.executable] + ['-W%s' % o for o in sys.warnoptions]
-    if py_script == django_main_path:
-        # The server was started with `python -m django runserver`.
-        args += ['-m', 'django']
-        args += sys.argv[1:]
-    elif not py_script.exists():
-        # sys.argv[0] may not exist for several reasons on Windows.
-        # It may exist with a .exe extension or have a -script.py suffix.
-        exe_entrypoint = py_script.with_suffix('.exe')
-        if exe_entrypoint.exists():
-            # Should be executed directly, ignoring sys.executable.
-            # TODO: Remove str() when dropping support for PY37.
-            # args parameter accepts path-like on Windows from Python 3.8.
-            return [str(exe_entrypoint), *sys.argv[1:]]
-        script_entrypoint = py_script.with_name('%s-script.py' % py_script.name)
-        if script_entrypoint.exists():
-            # Should be executed as usual.
-            # TODO: Remove str() when dropping support for PY37.
-            # args parameter accepts path-like on Windows from Python 3.8.
-            return [*args, str(script_entrypoint), *sys.argv[1:]]
-        raise RuntimeError('Script %s does not exist.' % py_script)
+    if __main__.__spec__ is not None:
+        if __main__.__spec__.parent == "":
+            # Python was started with the name of a directory or zip file
+            args += sys.argv
+        elif __main__.__spec__.parent == "django":
+            # The server was started with `python -m django runserver`
+            args += ['-m', 'django'] + sys.argv[1:]
+        else:
+            # Python was started with `-m pkg_other_than_django`
+            args += ['-m', __main__.__spec__.parent] + sys.argv[1:]
     else:
+        # Fallback to the original behavior if __spec__ is not set
         args += sys.argv
+
     return args
 
 
